package javango.test;

import java.util.ArrayList;

import com.google.inject.Injector;
import com.google.inject.Module;


public abstract class JavangoTestCase extends junit.framework.TestCase implements Module {
	
	protected Injector injector;
	
	public void configure(com.google.inject.Binder binder) {		
	}

	public abstract Class<? extends javango.api.Settings> getSettingsClass();
	
	@Override
	protected void setUp() throws Exception {
		super.setUp();
		java.util.List<Module> moduleList = new ArrayList<Module>();
		moduleList.add(this);
		injector = getSettingsClass().newInstance().createInjector(moduleList);
	}
	
	public Client getClient() {
		return injector.getInstance(Client.class);
	}
	
}
